package com.kakarote.oa.common;

/**
 * 0 自定义审批 1 普通审批 2 请假审批 3 出差审批 4 加班审批 5 差旅报销 6 借款申请
 *
 * @author wwl
 * @date 2022/7/19 18:04
 */

public enum OaExamineTypeEnum {

    CUSTOM(0, "自定义审批"),
    NORMAL(1, "普通审批"),
    ASK_FOR_LEAVE(2, "请假审批"),
    BUSINESS_TRIP(3, "出差审批"),
    WORK_OVERTIME(4, "加班审批"),
    TRAVEL_REIMBURSEMENT(5, "差旅报销"),
    BORROW_MONEY(6, "借款申请"),

    ;

    OaExamineTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private final Integer code;
    private final String msg;

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static OaExamineTypeEnum parse(Integer code) {
        for (OaExamineTypeEnum fieldTypeEnum : OaExamineTypeEnum.values()) {
            if (fieldTypeEnum.getCode().equals(code)) {
                return fieldTypeEnum;
            }
        }
        return NORMAL;
    }

}
